Micron Document
🎖️GitЯра🎖️


Displaying Raw • View renderedDownload

core/api/README.md renovate/net.java.dev.jna-jna-5.x (5a8f4966) Text, 3.26 KB

Tc9d1d9# `:core:api` (Meshtastic Android API)

Tff7b72> **Deprecation notice**
Tff7b72>
The AIDL-based service integration (`IMeshService`) is deprecated and will be removed in a future
Tff7b72> release. The recommended integration path for ATAK and other external apps is the built-in
Tff7b72> **Local TAK Server** introduced in `core:takserver`. Connect ATAK to `127.0.0.1:8087` (TCP) and
Tff7b72> import the DataPackage exported from the TAK Config screen to complete setup. No AIDL binding or
Tff7b72> JitPack dependency is required.

Tc9d1d9## Overview
The Ta5d6ff`:core:api` module contains the AIDL interface and dependencies for third-party applications
that currently integrate with the Meshtastic Android app via service binding. New integrations
should use the Local TAK Server instead (see deprecation notice above).

Tc9d1d9## Integration

To communicate with the Meshtastic Android service from your own application, we recommend using **JitPack**.

Tc9d1d9### Dependencies
Add the following to your Ta5d6ff`build.gradle.kts`:

Ta5d6ff```Ta5d6ffkotlin
Te6edf3dependencies Tb4b4b4{
T8b949e// The core AIDL interface and Intent constants
Te6edf3implementationTb4b4b4(Ta5d6ff"Ta5d6ffcom.github.meshtastic.Meshtastic-Android:meshtastic-android-api:v2.x.xTa5d6ff"Tb4b4b4)
T8b949e// Data models (DataPacket, MeshUser, NodeInfo, etc.) - Kotlin Multiplatform
Te6edf3implementationTb4b4b4(Ta5d6ff"Ta5d6ffcom.github.meshtastic.Meshtastic-Android:meshtastic-android-model:v2.x.xTa5d6ff"Tb4b4b4)
T8b949e// Protobuf definitions (PortNum, Telemetry, etc.) - Kotlin Multiplatform
Te6edf3implementationTb4b4b4(Ta5d6ff"Ta5d6ffcom.github.meshtastic.Meshtastic-Android:meshtastic-android-proto:v2.x.xTa5d6ff"Tb4b4b4)
Tb4b4b4}
Ta5d6ff```
*(Replace `v2.x.x` with the latest stable version).*

Tc9d1d9## Usage

Tc9d1d9### 1. Bind to the Service
Use the Ta5d6ff`IMeshService` interface to bind to the Meshtastic service.

Ta5d6ff```Ta5d6ffkotlin
Tff7b72val Te6edf3intent Tff7b72= Te6edf3IntentTb4b4b4(Ta5d6ff"Ta5d6ffcom.geeksville.mesh.ServiceTa5d6ff"Tb4b4b4)
T8b949e// ... query package manager and bind
Ta5d6ff```

Tc9d1d9### 2. Interact with the API
Once bound, cast the Ta5d6ff`IBinder` to Ta5d6ff`IMeshService`.

Tc9d1d9### 3. Register a BroadcastReceiver
Use Ta5d6ff`MeshtasticIntent` constants for actions. Remember to use Ta5d6ff`RECEIVER_EXPORTED` on Android 13+.

Tc9d1d9## Key Components
Tff7b72- **`IMeshService.aidl`**: The primary AIDL interface.
Tff7b72- **`MeshtasticIntent.kt`**: Defines Intent actions for received messages and status changes.

Tc9d1d9## Module dependency graph

<!--region graph-->
Ta5d6ff```Ta5d6ffmermaid
Ta5d6ffgraph TB
:core:api[api]:::android-library
:core:api --> :core:model

classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-application-compose fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef compose-desktop-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
classDef android-library-compose fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-library-compose fill:#FFC1CC,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-library fill:#FFC1CC,stroke:#000,stroke-width:2px,color:#000;
classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;

Ta5d6ff```
<!--endregion-->

Served by rngit 1.5.0 - Generated in 0.04s